/**
 * @(#) EquipmentPropertyInstance.java
 */

package cn.edu.sjtu.se.dslab.component.data;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "equipment_property_instance")
public class EquipmentPropertyInstance implements Serializable {

	private static final long serialVersionUID = -3234532004355664396L;

	private EquipmentProperty property;

	private String value;
	private long id;
	private AvionicsEquipment equipment;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "equipment_id", nullable = false)
	public AvionicsEquipment getEquipment() {
		return equipment;
	}

	public void setEquipment(AvionicsEquipment equipment) {
		this.equipment = equipment;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@JoinColumn(name = "property_id", nullable = false)
	public EquipmentProperty getProperty() {
		return property;
	}

	public void setProperty(EquipmentProperty property) {
		this.property = property;
	}

	@Column(name = "value")
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
